home *** CD-ROM | disk | FTP | other *** search
/ Champak 49 / Volume 49 - JOGO DISK .iso / Games / honeytrouble.swf / scripts / frame_9 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  29.9 KB  |  1,067 lines

  1. function tgt_forward()
  2. {
  3.    if(!startplay)
  4.    {
  5.       startplay = true;
  6.    }
  7.    var _loc2_ = 0;
  8.    for(var _loc3_ in tgt_mcs)
  9.    {
  10.       if(tgt_mcs[_loc3_]._x > 0 && tgt_mcs[_loc3_]._x < 560)
  11.       {
  12.          if(tgt_mcs[_loc3_]._y > 0 && tgt_mcs[_loc3_]._y < 400)
  13.          {
  14.             _loc2_ = _loc2_ + 1;
  15.          }
  16.       }
  17.    }
  18.    if(_loc2_ < _root["ballRollBackNum" + levelNum] && !setGameLevelStart)
  19.    {
  20.       if(!(EndBall._x > 0 && EndBall._x < 560 && EndBall._y > 0 && EndBall._y < 400) && (String(_root.removeTxName).length == 0 || _root.removeTxName == undefined) && !insert_bool)
  21.       {
  22.          tgt_speed = ballRollBackSpeeds;
  23.       }
  24.    }
  25.    if(tgt_speed > 50 && setGameLevelStart)
  26.    {
  27.       setGameLevelStart = null;
  28.    }
  29.    if(tgt_speed > min_speed)
  30.    {
  31.       if(_loc2_ < _root["rollOutAllBall" + levelNum] - rollAllBallCutNum && tgt_speed > 50)
  32.       {
  33.          tgt_speed -= speed_a;
  34.       }
  35.       else if(_loc2_ >= _root["rollOutAllBall" + levelNum] - rollAllBallCutNum || EndBall._x > 0 && EndBall._x < 560 && EndBall._y > 0 && EndBall._y < 400)
  36.       {
  37.          tgt_speed -= speed_a;
  38.          setGameLevelStart = null;
  39.       }
  40.    }
  41.    else if(tgt_speed < min_speed && tgt_speed > - posXishu and !Allstop)
  42.    {
  43.       tgt_speed += speed_a;
  44.    }
  45.    if(firstBall.pos < -200 && tgt_speed < 100)
  46.    {
  47.       if(!teBrak)
  48.       {
  49.          tgt_speed += Math.round(Math.abs(tgt_speed / 4));
  50.       }
  51.    }
  52.    if(tgt_speed < speed_a * 2)
  53.    {
  54.    }
  55.    if(boom_bool)
  56.    {
  57.       boom_lock_times++;
  58.       if(boom_lock_times >= boom_lock_total)
  59.       {
  60.          boom_bool = false;
  61.          forward_bool = true;
  62.          tgt_speed = min_speed;
  63.       }
  64.    }
  65.    else if(!forward_bool)
  66.    {
  67.       if(forward_num < forward_num_total)
  68.       {
  69.          goback_all_balls();
  70.          forward_num++;
  71.       }
  72.       else
  73.       {
  74.          forward_bool = true;
  75.          tgt_speed = min_speed;
  76.       }
  77.    }
  78.    else if(firstBall)
  79.    {
  80.       push_balls(firstBall,tgt_speed);
  81.    }
  82.    crt_new_ball();
  83.    if(insert_bool)
  84.    {
  85.       tgt_insert_move();
  86.    }
  87.    if(!boom_bool)
  88.    {
  89.       move_break();
  90.    }
  91.    check_fail();
  92.    if(gameTest)
  93.    {
  94.       draw_test_line();
  95.    }
  96.    if(speedCheck)
  97.    {
  98.       speed_listener.showSpeed();
  99.    }
  100.    levelTimes++;
  101. }
  102. function crt_new_ball()
  103. {
  104.    if(tgt_num < tgt_totalNum)
  105.    {
  106.       if(firstBall._name != undefined)
  107.       {
  108.          var _loc1_ = firstBall.pos;
  109.          if(_loc1_ > 0)
  110.          {
  111.             if(tgt_speed < posXishu)
  112.             {
  113.                if(_loc1_ >= posXishu)
  114.                {
  115.                   if(_loc1_ < posXishu + tgt_speed)
  116.                   {
  117.                      firstBall = tgt_push_first(_loc1_ - posXishu,getNewType(firstBall.type),false);
  118.                   }
  119.                   else
  120.                   {
  121.                      firstBall = tgt_push_first(0,getNewType(firstBall.type),true);
  122.                   }
  123.                }
  124.             }
  125.             else
  126.             {
  127.                firstBall = tgt_push_first(_loc1_ - posXishu,getNewType(firstBall.type),false);
  128.                if(firstBall.pos > posXishu)
  129.                {
  130.                   crt_new_ball();
  131.                }
  132.             }
  133.          }
  134.       }
  135.       else
  136.       {
  137.          firstBall = tgt_push_first(0,random(tgt_type) + 1);
  138.       }
  139.       setTgt_bar();
  140.    }
  141. }
  142. function tgt_push_first(pos, type, break_bool)
  143. {
  144.    var _loc2_ = tgt_mcs.attachMovie("targetBall","_t" + tgt_depth,tgt_depth);
  145.    setTag(_loc2_,true);
  146.    if(type == 10)
  147.    {
  148.       type = 1;
  149.    }
  150.    if(_root.blackandom == tgt_num)
  151.    {
  152.       _loc2_.gotoAndStop(9);
  153.       _root.black_ball_mc = _loc2_;
  154.       _loc2_.type = 10;
  155.       randomhei1 = 0;
  156.    }
  157.    else
  158.    {
  159.       _loc2_.gotoAndStop(type);
  160.       _loc2_.type = type;
  161.    }
  162.    if(tgt_num == tgt_totalNum - 1)
  163.    {
  164.       _loc2_.gotoAndStop(11);
  165.       _loc2_.type = 11;
  166.       EndBall = _loc2_;
  167.    }
  168.    _loc2_._x = pos_array[Math.floor(pos / lineXishu)].x;
  169.    _loc2_._y = pos_array[Math.floor(pos / lineXishu)].y;
  170.    if(!flower_show_bool)
  171.    {
  172.       _loc2_.cacheAsBitmap = true;
  173.       _loc2_.flower.roll_mc._visible = false;
  174.    }
  175.    _loc2_.goback_speed = 0;
  176.    _loc2_.goback_speed2 = 0;
  177.    _loc2_.pos = pos;
  178.    _loc2_.depth = tgt_depth;
  179.    _loc2_.removing = false;
  180.    _loc2_.checkTag = true;
  181.    tgt_depth++;
  182.    tgt_num++;
  183.    tgt_same_num++;
  184.    balls_num++;
  185.    type_num_array[type] = type_num_array[type] + 1;
  186.    if(break_bool == false)
  187.    {
  188.       211;
  189.       _loc2_.right = firstBall;
  190.       _loc2_.left = undefined;
  191.       _loc2_.link_right = undefined;
  192.       _loc2_.link_left = undefined;
  193.       firstBall.left = _loc2_;
  194.       firstBall.link_left = undefined;
  195.    }
  196.    else if(break_bool)
  197.    {
  198.       _loc2_.right = undefined;
  199.       _loc2_.left = undefined;
  200.       _loc2_.link_right = firstBall;
  201.       _loc2_.link_left = undefined;
  202.       firstBall.left = undefined;
  203.       firstBall.link_left = _loc2_;
  204.    }
  205.    else
  206.    {
  207.       _loc2_.right = undefined;
  208.       _loc2_.left = undefined;
  209.       _loc2_.link_right = undefined;
  210.       _loc2_.link_left = undefined;
  211.    }
  212.    return _loc2_;
  213. }
  214. function tgt_insert_start(obj, dir)
  215. {
  216.    teindir_sp = dir;
  217.    insert_times = 0;
  218.    if(dir == "left")
  219.    {
  220.       move_left_ball = obj.left;
  221.       move_right_ball = obj;
  222.       insert_pos = obj.pos - posXishu / 2;
  223.    }
  224.    else if(dir == "right")
  225.    {
  226.       move_left_ball = obj;
  227.       move_right_ball = obj.right;
  228.       insert_pos = obj.pos + posXishu / 2;
  229.    }
  230.    if(spSuperType == 10)
  231.    {
  232.    }
  233.    insert_bool = true;
  234. }
  235. function tgt_insert_move()
  236. {
  237.    if(move_left_ball._name == undefined && move_right_ball._name == undefined)
  238.    {
  239.       ball.holder.removeMovieClip();
  240.       delete ball;
  241.       crt_mc.gotoAndPlay(2);
  242.       insert_bool = false;
  243.    }
  244.    else
  245.    {
  246.       if(move_left_ball._name != undefined && move_right_ball._name != undefined)
  247.       {
  248.          insert_pos = Math.round((move_left_ball.pos + move_right_ball.pos) / 2);
  249.       }
  250.       else if(move_left_ball._name != undefined)
  251.       {
  252.          insert_pos = move_left_ball.pos + posXishu;
  253.       }
  254.       else
  255.       {
  256.          insert_pos = move_right_ball.pos - posXishu;
  257.       }
  258.       var _loc2_ = (pos_array[Math.floor(move_left_ball.pos / lineXishu) + 3].x + pos_array[Math.floor(move_left_ball.pos / lineXishu) + 2].x) / 2;
  259.       var _loc1_ = (pos_array[Math.floor(move_left_ball.pos / lineXishu) + 3].y + pos_array[Math.floor(move_left_ball.pos / lineXishu) + 2].y) / 2;
  260.       var _loc3_ = true;
  261.       ball.holder._x -= (ball.holder._x - _loc2_) / 3;
  262.       ball.holder._y -= (ball.holder._y - _loc1_) / 3;
  263.       if(teindir_sp == "left")
  264.       {
  265.          ball.holder._rotation -= 30;
  266.       }
  267.       else
  268.       {
  269.          ball.holder._rotation += 30;
  270.       }
  271.       insert_times++;
  272.       trace(" kinsert_times = " + insert_times);
  273.       if(insert_times <= insert_total_times)
  274.       {
  275.          push_balls(move_right_ball,insert_step);
  276.          pull_balls(move_left_ball,- insert_step);
  277.       }
  278.       if(insert_times == insert_total_times + 2)
  279.       {
  280.          insert_bool = false;
  281.          tgt_insert_end(insert_type);
  282.       }
  283.    }
  284. }
  285. function tgt_insert_end(type)
  286. {
  287.    crtNewBall();
  288.    ball.holder.removeMovieClip();
  289.    delete ball;
  290.    var _loc3_ = tgt_mcs.attachMovie("targetBall","_ts" + b_depth,b_depth);
  291.    setTag(_loc3_,false);
  292.    _loc3_.gotoAndStop(type);
  293.    _loc3_.type = type;
  294.    if(!flower_show_bool)
  295.    {
  296.       _loc3_.cacheAsBitmap = true;
  297.       _loc3_.flower.roll_mc._visible = false;
  298.    }
  299.    _loc3_.depth = b_depth;
  300.    _loc3_.pos = insert_pos;
  301.    _loc3_.removing = false;
  302.    _loc3_.checkTag = true;
  303.    _loc3_.goback_speed = 0;
  304.    _loc3_.goback_speed2 = 0;
  305.    trace(" carry from tgt_insert_end ");
  306.    updatePos(_loc3_,0,true);
  307.    b_depth++;
  308.    balls_num++;
  309.    type_num_array[type] = type_num_array[type] + 1;
  310.    if(move_left_ball._name != undefined)
  311.    {
  312.       move_right_ball = move_left_ball.right;
  313.    }
  314.    if(move_right_ball._name != undefined)
  315.    {
  316.       move_left_ball = move_right_ball.left;
  317.    }
  318.    if(move_left_ball.removing && move_right_ball.removing)
  319.    {
  320.       balls_num--;
  321.       type_num_array[_loc3_.type];
  322.       myGrid.pop(_loc3_._x,_loc3_._y,_loc3_,"tgt_ball");
  323.       _loc3_.removeMovieClip();
  324.    }
  325.    else
  326.    {
  327.       if(move_left_ball._name != undefined && move_right_ball._name != undefined)
  328.       {
  329.          _loc3_.left = move_left_ball;
  330.          _loc3_.right = move_right_ball;
  331.          _loc3_.link_right = undefined;
  332.          _loc3_.link_left = undefined;
  333.          move_left_ball.right = _loc3_;
  334.          move_left_ball.link_right = undefined;
  335.          move_right_ball.left = _loc3_;
  336.          move_right_ball.link_left = undefined;
  337.       }
  338.       else if(move_left_ball._name == undefined && move_right_ball._name != undefined)
  339.       {
  340.          _loc3_.left = undefined;
  341.          _loc3_.right = move_right_ball;
  342.          _loc3_.link_left = move_right_ball.link_left;
  343.          _loc3_.link_right = undefined;
  344.          move_right_ball.link_left.link_right = _loc3_;
  345.          move_right_ball.left = _loc3_;
  346.          move_right_ball.link_left = undefined;
  347.          if(move_right_ball == firstBall)
  348.          {
  349.             firstBall = _loc3_;
  350.          }
  351.          else
  352.          {
  353.             if(_loc3_.type == _loc3_.link_left.type)
  354.             {
  355.                _loc3_.goback_speed = init_goback_speed;
  356.             }
  357.             else
  358.             {
  359.                _loc3_.goback_speed = 0;
  360.             }
  361.             break_array_pop(move_right_ball);
  362.             break_array.push(_loc3_);
  363.          }
  364.       }
  365.       else if(move_left_ball._name != undefined && move_right_ball._name == undefined)
  366.       {
  367.          _loc3_.left = move_left_ball;
  368.          _loc3_.right = undefined;
  369.          _loc3_.link_left = undefined;
  370.          _loc3_.link_right = move_left_ball.link_right;
  371.          move_left_ball.link_right.link_left = _loc3_;
  372.          move_left_ball.right = _loc3_;
  373.          move_left_ball.link_right = undefined;
  374.       }
  375.       else
  376.       {
  377.          balls_num--;
  378.          type_num_array[_loc3_.type]--;
  379.          myGrid.pop(_loc3_._x,_loc3_._y,_loc3_,"tgt_ball");
  380.          _loc3_.removeMovieClip();
  381.       }
  382.       if(_loc3_.pos != undefined)
  383.       {
  384.          if(_loc3_.right._name != undefined)
  385.          {
  386.             align_left_balls(_loc3_.right);
  387.          }
  388.          if(_loc3_.left._name != undefined)
  389.          {
  390.             align_right_balls(_loc3_.left);
  391.          }
  392.          if(insert_type == 7)
  393.          {
  394.             this.attachMovie("sp1","sp1",this.getNextHighestDepth(),{_x:_loc3_._x,_y:_loc3_._y});
  395.             _loc3_.type = 10;
  396.             checkRemove(_loc3_,0);
  397.             subtract();
  398.             teBrak = 1;
  399.             forward_bool = false;
  400.             forward_num = -10;
  401.             goback_all_balls();
  402.             PropUse = false;
  403.          }
  404.          else if(insert_type == 8)
  405.          {
  406.             _loc3_.type = 10;
  407.             checkRemove(_loc3_,0);
  408.             subtract();
  409.          }
  410.          else if(insert_type == 9)
  411.          {
  412.             this.attachMovie("sp2","sp2",this.getNextHighestDepth(),{_x:_loc3_._x,_y:_loc3_._y});
  413.             _loc3_.type = 10;
  414.             checkRemove(_loc3_,0);
  415.             subtract();
  416.             var teConte = 100;
  417.             this.onEnterFrame = function()
  418.             {
  419.                Allstop = true;
  420.                teConte--;
  421.                if(!teConte)
  422.                {
  423.                   Allstop = false;
  424.                   delete this.onEnterFrame;
  425.                }
  426.             };
  427.             PropUse = false;
  428.          }
  429.          if(_root.holdBall)
  430.          {
  431.             checkRemove(_loc3_,0);
  432.             subtract();
  433.          }
  434.          if(_root.jumpBall)
  435.          {
  436.             checkRemove(_loc3_,0);
  437.          }
  438.          else
  439.          {
  440.             checkRemove(_loc3_,initCanRemoveNum);
  441.          }
  442.       }
  443.    }
  444. }
  445. function checkRemove(obj, CanRemoveNum)
  446. {
  447.    trace(" obj = " + obj + " CanRemoveNum = " + CanRemoveNum);
  448.    var _loc3_ = [obj];
  449.    var _loc5_ = obj.right;
  450.    var _loc4_ = obj.left;
  451.    var _loc14_ = _loc5_.right;
  452.    var _loc12_ = _loc4_.left;
  453.    if(_root.jumpBall)
  454.    {
  455.       if(_root.ooo > 0)
  456.       {
  457.          _loc3_.unshift(_loc4_);
  458.       }
  459.    }
  460.    else
  461.    {
  462.       while(_loc5_._name != undefined && obj.type == _loc5_.type && !_loc5_.removing)
  463.       {
  464.          _loc3_.push(_loc5_);
  465.          _loc5_ = _loc5_.right;
  466.       }
  467.       while(_loc4_._name != undefined && obj.type == _loc4_.type && !_loc4_.removing)
  468.       {
  469.          _loc3_.unshift(_loc4_);
  470.          _loc4_ = _loc4_.left;
  471.       }
  472.    }
  473.    if(_root.ooo)
  474.    {
  475.       _loc3_.shift();
  476.    }
  477.    if(_loc3_.length > CanRemoveNum)
  478.    {
  479.       sp_xiqiu = true;
  480.       var _loc7_ = new Object();
  481.       _loc7_.tgt_remove_num = 0;
  482.       _loc7_.id = random(65535);
  483.       _loc7_.remove_array = _loc3_;
  484.       remove_arr_array[_loc7_.id] = _loc7_;
  485.       remove_sound.start(0);
  486.       i = 0;
  487.       while(i < _loc3_.length)
  488.       {
  489.          _loc3_[i].remove_id = _loc7_.id;
  490.          myGrid.pop(_loc3_[i]._x,_loc3_[i]._y,_loc3_[i],"tgt_ball");
  491.          _loc3_[i].removing = true;
  492.          _loc3_[i].gotoAndPlay("remove");
  493.          i++;
  494.       }
  495.       trace(" myGrid = " + myGrid);
  496.       if(_root.ball == undefined)
  497.       {
  498.          _root.crtNewBall();
  499.          if(_root.holdBall)
  500.          {
  501.             _root.holdBall = false;
  502.             holdBall_mc.attachMovie("hold_mc","hold_mc",this.getDepth() + 1);
  503.             holdBall_mc.hold_mc._x = hold_mx.x;
  504.             holdBall_mc.hold_mc._y = hold_mx.y;
  505.          }
  506.       }
  507.    }
  508.    else
  509.    {
  510.       maxcomboTE = 0;
  511.    }
  512.    _root.number_num = _root.number_num + 1;
  513.    if(_root.jumpBall)
  514.    {
  515.       _root.ooo = _root.ooo + 1;
  516.       if(_root.ooo < 6 && _loc4_.left != _root.EndBall && _loc4_.left != undefined && _loc4_.left != firstBall)
  517.       {
  518.          checkRemove(_loc4_.left,0);
  519.          subtract();
  520.       }
  521.       else
  522.       {
  523.          _root.ooo = 0;
  524.          _root.jumpBall = false;
  525.       }
  526.    }
  527.    trace("PowerMC.hong._x" + PowerMC.hong._x + "PowerMC.hong2._x" + PowerMC.hong._x + "=====");
  528.    if(PowerMC.hong._x >= -6)
  529.    {
  530.       PowerMC.hong._x = -110;
  531.       PowerMC.hong2._x = -110;
  532.    }
  533.    var _loc9_ = _root.unblack == undefined;
  534.    var _loc10_ = _root.black_ball_mc != undefined && _root.black_ball_mc != "";
  535.    var _loc11_ = _root.black_ball_mc.left._currentframe >= 13 && _root.black_ball_mc.left._currentframe != undefined || _root.black_ball_mc.left == undefined;
  536.    var _loc8_ = _root.black_ball_mc.right._currentframe >= 13 && _root.black_ball_mc.right._currentframe != undefined || _root.black_ball_mc.right == undefined;
  537.    trace([_loc9_,_loc10_,_loc11_,_loc8_,_root.black_ball_mc]);
  538.    if(_loc9_ && _loc10_ && _loc11_ && _loc8_ && String(_root.black_ball_mc).length != 0)
  539.    {
  540.       trace("-------------------------------:  remove the black ball:" + _root.black_ball_mc);
  541.       _root.unblack = 1;
  542.       checkRemove(_root.black_ball_mc,0);
  543.       delete _root.unblack;
  544.    }
  545. }
  546. function remove_movie_end(id)
  547. {
  548.    if(remove_arr_array[id].remove_array.length > remove_arr_array[id].tgt_remove_num + 1)
  549.    {
  550.       remove_arr_array[id].tgt_remove_num = remove_arr_array[id].tgt_remove_num + 1;
  551.    }
  552.    else
  553.    {
  554.       remove_ball(id);
  555.    }
  556. }
  557. function remove_one(obj)
  558. {
  559.    var _loc1_ = new Object();
  560.    _loc1_.tgt_remove_num = 0;
  561.    _loc1_.id = random(65535);
  562.    _loc1_.remove_array = [obj];
  563.    remove_arr_array[_loc1_.id] = _loc1_;
  564.    obj.remove_id = _loc1_.id;
  565.    obj.gotoAndPlay("remove_one");
  566.    obj.removing = true;
  567.    myGrid.pop(obj._x,obj._y,obj,"tgt_ball");
  568. }
  569. function remove_ball(id)
  570. {
  571.    var _loc3_ = remove_arr_array[id].remove_array;
  572.    delete remove_arr_array[id];
  573.    var _loc12_ = _loc3_[0];
  574.    var _loc11_ = _loc3_[_loc3_.length - 1];
  575.    var _loc10_ = _loc12_.left;
  576.    var _loc9_ = _loc11_.right;
  577.    if(_loc10_._name == undefined && _loc9_._name == undefined)
  578.    {
  579.       _loc12_.link_left.link_right = _loc11_.link_right;
  580.       _loc11_.link_right.link_left = _loc12_.link_left;
  581.       if(_loc12_ == firstBall)
  582.       {
  583.          firstBall = _loc11_.link_right;
  584.       }
  585.    }
  586.    else if(_loc10_._name == undefined)
  587.    {
  588.       _loc9_.left = undefined;
  589.       _loc9_.link_left = _loc12_.link_left;
  590.       _loc9_.link_left.link_right = _loc9_;
  591.       if(_loc12_ == firstBall)
  592.       {
  593.          firstBall = _loc9_;
  594.       }
  595.    }
  596.    else if(_loc9_._name == undefined)
  597.    {
  598.       _loc10_.right = undefined;
  599.       _loc10_.link_right = _loc11_.link_right;
  600.       _loc10_.link_right.link_left = _loc10_;
  601.    }
  602.    else
  603.    {
  604.       _loc10_.right = undefined;
  605.       _loc9_.left = undefined;
  606.       _loc10_.link_right = _loc9_;
  607.       _loc9_.link_left = _loc10_;
  608.    }
  609.    trace(goal * _loc3_.length + "==AA==");
  610.    setGoal(int(goal * _loc3_.length));
  611.    var _loc13_ = _root.attachMovie("appearPoint","appearPoint" + _root.getNextHighestDepth(),_root.getNextHighestDepth());
  612.    _loc13_._x = _loc11_._x;
  613.    _loc13_._y = _loc11_._y;
  614.    _loc13_.addItemPoint = goal * _loc3_.length;
  615.    getPower();
  616.    if(comboPD)
  617.    {
  618.       maxcombonumTE += _loc3_.length;
  619.       if(sp_xiqiu)
  620.       {
  621.          combotol++;
  622.          maxcomboTE++;
  623.       }
  624.       if(maxcomboTE > 0)
  625.       {
  626.          if(!combo)
  627.          {
  628.             _root.attachMovie("combo","combo",10000);
  629.             combo._x = _loc13_._x;
  630.             combo._y = _loc13_._y;
  631.          }
  632.          else
  633.          {
  634.             combo.gotoAndPlay("disp");
  635.          }
  636.          setGoal(100 * combotol);
  637.       }
  638.       comboPD = false;
  639.    }
  640.    else
  641.    {
  642.       maxcomboTE = 0;
  643.       maxcombonumTE = _loc3_.length;
  644.    }
  645.    if(maxcomboTE > maxcombo)
  646.    {
  647.       maxcombo = maxcomboTE;
  648.    }
  649.    if(maxcombonumTE > maxcombonum)
  650.    {
  651.       maxcombonum = maxcombonumTE;
  652.    }
  653.    i = 0;
  654.    while(i < _loc3_.length)
  655.    {
  656.       if(_loc3_[i].checkTag)
  657.       {
  658.          if(_loc3_[i].tag == "bo")
  659.          {
  660.             var _loc6_ = _loc3_[i].idnum;
  661.             var _loc5_ = _root.attachMovie("showTebieCartoon","showTebieCartoon" + _root.getNextHighestDepth(),_root.getNextHighestDepth());
  662.             _loc5_._x = _loc3_[i]._x;
  663.             _loc5_._y = _loc3_[i]._y;
  664.             _loc5_.pic.gotoAndStop(_loc6_);
  665.             var _loc2_ = 0;
  666.             while(_loc2_ < cha_arr.length)
  667.             {
  668.                if(_loc6_ == cha_arr[_loc2_] && cha_arr2[_loc2_] != 1)
  669.                {
  670.                   if(cha_arr[_loc2_] == "h")
  671.                   {
  672.                      _root.poop1.gotoAndStop(2);
  673.                   }
  674.                   else if(cha_arr[_loc2_] == "o")
  675.                   {
  676.                      _root.poop2.gotoAndStop(3);
  677.                   }
  678.                   else if(cha_arr[_loc2_] == "n")
  679.                   {
  680.                      _root.poop3.gotoAndStop(4);
  681.                   }
  682.                   else if(cha_arr[_loc2_] == "e")
  683.                   {
  684.                      _root.poop4.gotoAndStop(5);
  685.                   }
  686.                   else if(cha_arr[_loc2_] == "y")
  687.                   {
  688.                      _root.poop5.gotoAndStop(6);
  689.                   }
  690.                   cha_arr.splice(_loc2_,1);
  691.                   cha_arr2.splice(_loc2_,1);
  692.                   cha_has++;
  693.                }
  694.                if(cha_has >= 5)
  695.                {
  696.                   cha_has = 0;
  697.                   cha_arr = ["h","o","n","e","y"];
  698.                   cha_arr2 = [0,0,0,0,0];
  699.                   re_back_func_();
  700.                   _root.attachMovie("movieClassMC","movieClassMC" + _root.getNextHighestDepth(),_root.getNextHighestDepth(),{_x:158,_y:172});
  701.                   next_leve_func();
  702.                   break;
  703.                }
  704.                _loc2_ = _loc2_ + 1;
  705.             }
  706.          }
  707.          if(_loc3_[i].tag == "dir")
  708.          {
  709.             trace(_loc3_[i].tag);
  710.             dir_bool = true;
  711.             dir_num = 0;
  712.             dir_sound.start(0);
  713.             var _loc4_ = random(255);
  714.             tags_mc.attachMovie("dirs_mc","tags" + _loc4_,_loc4_);
  715.             tags_mc["tags" + _loc4_]._x = _loc3_[i]._x;
  716.             tags_mc["tags" + _loc4_]._y = _loc3_[i]._y;
  717.          }
  718.          else if(insert_type == 8)
  719.          {
  720.             boom_bool = true;
  721.             boom_lock_times = 0;
  722.             ball_boom(_loc3_[i]);
  723.             boom_sound.start(0);
  724.             _loc4_ = random(255);
  725.             tags_mc.attachMovie("booms","tags" + _loc4_,_loc4_);
  726.             tags_mc["tags" + _loc4_]._x = _loc3_[i]._x;
  727.             tags_mc["tags" + _loc4_]._y = _loc3_[i]._y;
  728.          }
  729.       }
  730.       balls_num--;
  731.       type_num_array[_loc3_[i].type]--;
  732.       _loc3_[i].removeMovieClip();
  733.       i++;
  734.    }
  735.    if(_loc9_._name != undefined)
  736.    {
  737.       if(_loc9_.type == _loc9_.link_left.type)
  738.       {
  739.          comboPD = true;
  740.          _loc9_.goback_speed = init_goback_speed;
  741.       }
  742.       else
  743.       {
  744.          _loc9_.goback_speed = 0;
  745.       }
  746.       break_array.push(_loc9_);
  747.       sp_xiqiu = false;
  748.    }
  749. }
  750. function cheangball()
  751. {
  752.    if(tgt_num >= tgt_totalNum && balls_num < 25)
  753.    {
  754.       while(type_num_array[ball.type] == 0 && balls_num != 0 && !superBall)
  755.       {
  756.          ball.type = random(tgt_type) + 1;
  757.          ball.holder.gotoAndStop(ball.type);
  758.          center_mc.nextBall2.type = ball.type;
  759.          center_mc.nextBall.type = ball.type;
  760.          center_mc.nextBall.gotoAndStop(ball.type);
  761.          center_mc.nextBall2.gotoAndStop(ball.type);
  762.       }
  763.    }
  764. }
  765. function cheangballHS()
  766. {
  767.    if(ball)
  768.    {
  769.       var _loc1_ = ball.type;
  770.       tmp0_type = tmp_ball_ball_type_arr[0];
  771.       tmp1_type = tmp_ball_ball_type_arr[1];
  772.       tmp2_type = tmp_ball_ball_type_arr[2];
  773.       tmp_ball_ball_type_arr[0] = tmp2_type;
  774.       tmp_ball_ball_type_arr[1] = tmp0_type;
  775.       tmp_ball_ball_type_arr[2] = tmp1_type;
  776.       ball_type_change = true;
  777.       ball.holder.gotoAndStop(tmp_ball_ball_type_arr[0]);
  778.       center_mc.nextBall.gotoAndStop(tmp_ball_ball_type_arr[1]);
  779.       center_mc.nextBall2.gotoAndStop(tmp_ball_ball_type_arr[2]);
  780.    }
  781. }
  782. function move_break()
  783. {
  784.    var _loc2_ = undefined;
  785.    i = 0;
  786.    while(i < break_array.length)
  787.    {
  788.       _loc2_ = break_array[i];
  789.       if(_loc2_.link_left._name != undefined)
  790.       {
  791.          var _loc4_ = undefined;
  792.          if(_loc2_.type != _loc2_.link_left.type)
  793.          {
  794.             _loc4_ = posXishu;
  795.          }
  796.          else
  797.          {
  798.             _loc4_ = posXishu - _loc2_.goback_speed;
  799.          }
  800.          if(mcDistance2(_loc2_,_loc2_.link_left) <= _loc4_)
  801.          {
  802.             var _loc3_ = find_break_ball(_loc2_.link_left);
  803.             if(_loc3_ == firstBall)
  804.             {
  805.                if(_loc2_.goback_speed2 == 0)
  806.                {
  807.                   tgt_speed += Math.round(_loc2_.goback_speed * 0.6);
  808.                }
  809.                else
  810.                {
  811.                   tgt_speed += Math.round(_loc2_.goback_speed2 * 0.8);
  812.                }
  813.                tgt_speed = Math.max(tgt_speed,max_goback_speed);
  814.             }
  815.             else if(_loc2_.goback_speed2 == 0)
  816.             {
  817.                _loc3_.goback_speed2 = Math.round(_loc2_.goback_speed * 0.8);
  818.             }
  819.             else
  820.             {
  821.                _loc3_.goback_speed2 = Math.round(_loc2_.goback_speed2 * 0.8);
  822.             }
  823.             _loc2_.goback_speed = 0;
  824.             _loc2_.goback_speed2 = 0;
  825.             attach_sound.start(0);
  826.             break_array_pop(_loc2_);
  827.             _loc2_.left = _loc2_.link_left;
  828.             _loc2_.left.right = _loc2_;
  829.             _loc2_.link_left = undefined;
  830.             _loc2_.left.link_right = undefined;
  831.             if(_loc2_.type == _loc2_.left.type && _root.jumpBall != true)
  832.             {
  833.                checkRemove(_loc2_,initCanRemoveNum);
  834.             }
  835.             while(_loc2_._name != undefined)
  836.             {
  837.                _loc2_.pos = _loc2_.left.pos + posXishu;
  838.                _loc2_ = _loc2_.right;
  839.             }
  840.          }
  841.          else if(_loc2_.type == _loc2_.link_left.type)
  842.          {
  843.             push_balls(_loc2_,_loc2_.goback_speed);
  844.             _loc2_.goback_speed += init_goback_speed * 0.8;
  845.             _loc2_.goback_speed = Math.max((- posXishu) * 1.2,_loc2_.goback_speed);
  846.          }
  847.          else if(_loc2_.goback_speed2 < 0)
  848.          {
  849.             push_balls(_loc2_,_loc2_.goback_speed2);
  850.             _loc2_.goback_speed2 += 5;
  851.          }
  852.       }
  853.       i++;
  854.    }
  855. }
  856. function check_break(obj)
  857. {
  858.    if(obj.pos > 0 && obj.pos < pos_array.length * posXishu)
  859.    {
  860.       if(obj.link_left._name != undefined)
  861.       {
  862.          if(mcDistance2(obj,obj.link_left) <= posXishu)
  863.          {
  864.             obj.left = obj.link_left;
  865.             obj.left.right = obj;
  866.             obj.link_left = undefined;
  867.             obj.left.link_right = undefined;
  868.             break_array_pop(obj);
  869.             align_right_balls(ball2);
  870.          }
  871.       }
  872.       if(obj.link_right._name != undefined)
  873.       {
  874.          if(mcDistance2(obj,obj.link_right) <= posXishu)
  875.          {
  876.             obj.right = obj.link_right;
  877.             obj.right.left = obj;
  878.             obj.link_right = undefined;
  879.             obj.right.link_left = undefined;
  880.             break_array_pop(obj);
  881.             align_left_balls(ball2);
  882.          }
  883.       }
  884.    }
  885. }
  886. function lost_func2()
  887. {
  888.    lost_game_blo = false;
  889.    _level0.BOX_x.unloadMovie();
  890.    delete _root.BAllID;
  891.    delete move_listener_mc.onEnterFrame;
  892.    setLife(-1);
  893.    dir_mc.clear();
  894.    failMovie_mc.gotoAndPlay(3);
  895. }
  896. function check_fail()
  897. {
  898.    find_last();
  899.    if(last_pos > pos_array.length * lineXishu && !last_ball.removing)
  900.    {
  901.       holdBall_mc.hold_mc.unloadMovie();
  902.       hold_mx.num = 0;
  903.       delete _root.holdBall;
  904.       _root.holdBall2 == false;
  905.       if(!gameOver)
  906.       {
  907.          _level0.BOX_x.unloadMovie();
  908.          delete _root.BAllID;
  909.          gameZT = "σñ▒Φ┤Ñ";
  910.          tgt_speed = 160;
  911.          min_speed = -10000;
  912.          tgt_totalNum = 0;
  913.          speed_a *= -1;
  914.          gameOver = true;
  915.          a;
  916.          m_lock = true;
  917.          clearBall();
  918.          bg_sound.stop();
  919.          create_lost_Sound();
  920.       }
  921.       if(_root.EndBall == firstBall || balls_num < 2 || lost_game_blo)
  922.       {
  923.          lost_game_blo = false;
  924.          _level0.BOX_x.unloadMovie();
  925.          delete _root.BAllID;
  926.          delete move_listener_mc.onEnterFrame;
  927.          trace("Φ╜╜σàÑσñ▒Φ┤Ñσè¿τö╗  ");
  928.          lost_func2();
  929.          bg_sound.stop();
  930.       }
  931.       last_ball.left.right = undefined;
  932.       balls_num--;
  933.       type_num_array[last_ball.type]--;
  934.       myGrid.pop(last_ball._x,last_ball._y,last_ball,"tgt_ball");
  935.       last_ball.removeMovieClip();
  936.    }
  937.    else if(balls_num <= 2 && _root.ball_number_n == 0 && _root.EndBall != undefined && String(typeof _root.EndBall.length > 0) && _root.EndBall.right == undefined && _root.EndBall.left == undefined)
  938.    {
  939.       if(balls_num == 2)
  940.       {
  941.          var _loc2_ = [];
  942.          for(var _loc3_ in _level0.tgt_mcs)
  943.          {
  944.             _loc2_.push(_level0.tgt_mcs[_loc3_]);
  945.             if(_loc3_.substr(2,1) == "s")
  946.             {
  947.                _level0.BOX_x.unloadMovie();
  948.                next_leve_func();
  949.                trace("+++++++++++++++++++++++++++++++++++");
  950.                break;
  951.             }
  952.          }
  953.          if(_root.dis_func(_loc2_[0],_loc2_[1]) < 15)
  954.          {
  955.             _level0.BOX_x.unloadMovie();
  956.             delete _root.BAllID;
  957.             gameZT = "σñ▒Φ┤Ñ";
  958.             tgt_speed = 160;
  959.             min_speed = -10000;
  960.             tgt_totalNum = 0;
  961.             speed_a *= -1;
  962.             gameOver = true;
  963.             a;
  964.             m_lock = true;
  965.             clearBall();
  966.          }
  967.       }
  968.       else if(balls_num == 1)
  969.       {
  970.          _level0.BOX_x.unloadMovie();
  971.          next_leve_func();
  972.          trace("--------------------------------------------------------------------------");
  973.       }
  974.    }
  975.    else if(balls_num <= 2 && _root.ball_number_n == 0 && _root.EndBall.right._currentframe == 9)
  976.    {
  977.       holdBall_mc.hold_mc.unloadMovie();
  978.       hold_mx.num = 0;
  979.       delete _root.holdBall;
  980.       _root.holdBall2 == false;
  981.       if(balls_num <= 1 && _root.EndBall.right._currentframe == 9)
  982.       {
  983.          _level0.BOX_x.unloadMovie();
  984.          delete _root.BAllID;
  985.          next_leve_func();
  986.       }
  987.       else if(balls_num == 2 && _root.EndBall.right._currentframe == 9 && String(_root.EndBall).length != 0)
  988.       {
  989.          _level0.BOX_x.unloadMovie();
  990.          delete _root.BAllID;
  991.          next_leve_func();
  992.       }
  993.    }
  994.    else if((last_ball._name == undefined && firstBall._name == undefined or balls_num == 1 and firstBall._name == EndBall._name) && tgt_num >= tgt_totalNum - 1)
  995.    {
  996.       holdBall_mc.hold_mc.unloadMovie();
  997.       hold_mx.num = 0;
  998.       delete _root.holdBall;
  999.       _root.holdBall2 == false;
  1000.       _level0.BOX_x.unloadMovie();
  1001.       delete _root.BAllID;
  1002.       gameZT = "Φ┐çσà│";
  1003.       win_sound_.start();
  1004.       delete move_listener_mc.onEnterFrame;
  1005.       superBall = false;
  1006.       m_lock = true;
  1007.       clearBall();
  1008.       dir_mc.clear();
  1009.       trace("clear ball " + ball);
  1010.       mouth.TX.play();
  1011.       move_listener_mc.onEnterFrame = function()
  1012.       {
  1013.          if(!game_pause)
  1014.          {
  1015.             winMove();
  1016.          }
  1017.       };
  1018.       var _loc4_ = 0;
  1019.       cha_arr = ["h","o","n","e","y"];
  1020.       cha_arr2 = [0,0,0,0,0];
  1021.    }
  1022.    lastBlackBall();
  1023. }
  1024. function getPower()
  1025. {
  1026.    if(PowerNum >= 10)
  1027.    {
  1028.       return undefined;
  1029.    }
  1030.    PowerNum++;
  1031.    if(boom_num > 0)
  1032.    {
  1033.       boom_num--;
  1034.       PowerNum--;
  1035.       if(PowerMC.hong._x < -6)
  1036.       {
  1037.          PowerMC.hong._x -= -6;
  1038.          PowerMC.hong2._x -= -6;
  1039.       }
  1040.    }
  1041.    if(PowerMC.hong._x < -6)
  1042.    {
  1043.       PowerMC.hong._x += PowerStup;
  1044.       PowerMC.hong2._x += PowerStup;
  1045.    }
  1046. }
  1047. function subtract()
  1048. {
  1049.    PowerNum--;
  1050.    if(PowerMC.hong._x < -6)
  1051.    {
  1052.       PowerMC.hong._x -= PowerStup;
  1053.       PowerMC.hong2._x -= PowerStup;
  1054.    }
  1055. }
  1056. var EndBall;
  1057. var teindir_sp;
  1058. _root.ooo = 0;
  1059. var sp_xiqiu = false;
  1060. if(dd)
  1061. {
  1062.    _root.black_ball_mc._visible = false;
  1063.    checkRemove(_root.black_ball_mc,0);
  1064. }
  1065. var PowerStup = 12;
  1066. var PowerNum = 0;
  1067.